package com.cn.longdistancebusstation.enumxx;

/**
 * Created by mal on 2018/1/24.
 */

public enum TicketStatus {
    TICKET_WAITING_PAY(0, "待支付"),
    TICKET_PAY(1, "已支付"),
    TICKET_CANCEL(2, "已取消"),
    TICKET_REFUND(3, "已退票"),
    TICKET_PRINT(4, "已出票");
    public int code;
    public String desc;
    TicketStatus(int code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public static TicketStatus getTicketStatus(int status){
        for(TicketStatus ticketStatus:values()){
            if(status == ticketStatus.code){
                return ticketStatus;
            }
        }
        return TICKET_WAITING_PAY;
    }
}

